<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/12/13/0013
 * Time: 9:44
 */

namespace app\sports_admin\model;


use think\Db;
use think\Model;
use traits\model\SoftDelete;

class SuggestionType extends Model
{
    use SoftDelete;
    protected $pk = 'id';

    protected $table = 'suggestion_type';

    protected $autoWriteTimestamp = true;


    /**
     * 获取类别信息
     */
    public static function getTypeList()
    {
        return self::field('id,path,title,concat(path,id) as type,parent_id')->order("type")->select();
    }
    /**
     * 查询是否有子类
    */
    public static function getTypeChild($id)
    {
        return self::field('id,path,title,concat(path,id) as type,parent_id')->where('parent_id',$id)->find();
    }

}